<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Hexo Theme Redefine">
    <meta name="description" content="Hexo Theme Redefine">
    <meta name="author" content="茶小李">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-redefine.png">
    
    <!--- Seo Part-->
    
    <link rel="canonical" href="http://example.com/2023/09/15/tweenmanager/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    <meta property="og:type" content="article">
    <meta property="og:title" content="TweenManager--cocoscreator">
    <meta property="og:description" content="Hexo Theme Redefine">
    <meta property="og:url" content="http://example.com2023/09/15/TweenManager/">
    
    <meta property="og:site_name" content="茶小李">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="TweenManager--cocoscreator">
    <meta name="twitter:description" content="Hexo Theme Redefine">
    <meta name="twitter:image" content="/images/redefine-logo.svg">
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/images/redefine-logo.svg" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/redefine-logo.svg">
    <meta name="theme-color" content="#005080">
    <link rel="shortcut icon" href="/images/redefine-logo.svg">
    
    <title>
        
            TweenManager--cocoscreator -
        
        茶小李
    </title>
    
<link rel="stylesheet" href="/css/style.css">

    
<link rel="stylesheet" href="/assets/fonts.css">

    
    
    
    <script id="hexo-configurations">
    let REDEFINE = window.REDEFINE || {};
    REDEFINE.hexo_config = {"hostname":"example.com","root":"/","language":"zh-CN"};
    REDEFINE.theme_config = {"toc":{"enable":true,"number":false,"expand_all":true,"init_open":true},"style":{"primary_color":"#005080","avatar":"/images/redefine-avatar.svg","favicon":"/images/redefine-logo.svg","og_image":{"enable":false,"image_url":null},"article_img_align":"center","right_side_width":"210px","content_max_width":"1000px","nav_color":{"left":"#f78736","right":"#367df7","transparency":35},"hover":{"shadow":true,"scale":false},"first_screen":{"enable":true,"background_image":{"light":"/images/wallhaven-wqery6-light.webp","dark":"/images/wallhaven-wqery6-dark.webp"},"title_color":{"light":"#fff","dark":"#d1d1b6"},"font_sizes":{"title":"2.8rem","subtitle":"1.5rem"},"line_height":1.2,"title":"茶小李的记录","subtitle":{"enable":false,"list":[]},"custom_font":{"enable":false,"font_family":null,"font_url":null}},"scroll":{"progress_bar":{"enable":true},"percent":{"enable":false}}},"local_search":{"enable":false,"preload":true},"code_block":{"copy":true,"style":"simple","custom_font":{"enable":false,"font_family":null,"font_url":null}},"pjax":{"enable":true},"lazyload":{"enable":true},"version":"1.2.1","friend_links":{"columns":2},"home_article":{"date_format":"auto","category":{"enable":true,"limit":3},"tag":{"enable":true,"limit":3}},"plugins":{"aplayer":{"enable":true,"audio":[{"name":"Something Just Like This","artist":"Coldplay","url":"https://evan.beee.top/music/Something%20Just%20Like%20This%20-%20The%20Chainsmokers%E3%80%81Coldplay.mp3","cover":"https://evan.beee.top/music/covers/Something_Just_Like_This.png"},{"name":"Imagine","artist":"John Lennon","url":"https://evan.beee.top/music/Imagine%20-%20John%20Lennon.mp3","cover":"https://evan.beee.top/music/covers/Lennon_Imagine_Sleeve_1975.jpg"},{"name":"Empire Of Ange","artist":"Eternal","url":"/music/Empire Of Ange.mp3","cover":"https://evan.beee.top/music/covers/Something_Just_Like_This.png"}],"mini":true},"mermaid":{"enable":false,"version":"9.3.0"}}};
    REDEFINE.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
  </script>
    
    
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/fontawesome/regular.min.css">

    
    
    
    
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
<div class="progress-bar-container">
    
        <span class="scroll-progress-bar"></span>
    

    
        <span class="pjax-progress-bar"></span>
        <span class="pjax-progress-icon">
            <i class="fa-solid fa-circle-notch fa-spin"></i>
        </span>
    
</div>


<main class="page-container">

    

    <div class="page-main-content">

        <div class="page-main-content-top">
            <header class="menu-wrapper">
    
    <div class="menu-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                
                茶小李
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="pc">
                <ul class="menu-list">
                    
                        
                            <li class="menu-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/"  >
                                    
                                        
                                            <i class="fa-regular fa-house"></i>
                                        
                                        首页
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="menu-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/Image"  >
                                    
                                        
                                            <i class="fa-regular fa-image"></i>
                                        
                                        图片
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="menu-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/Code"  >
                                    
                                        
                                            <i class="fa-regular fa-code"></i>
                                        
                                        CODE
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                <div class="icon-item menu-bar">
                    <div class="menu-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile drawer -->
    <div class="menu-drawer">
        <ul class="drawer-menu-list">
            
                
                    <li class="drawer-menu-item flex-center">
                        <a class="" 
                        href="/"  >
                             
                                
                                    <i class="fa-regular fa-house"></i>
                                
                                首页
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-menu-item flex-center">
                        <a class="" 
                        href="/Image"  >
                             
                                
                                    <i class="fa-regular fa-image"></i>
                                
                                图片
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-menu-item flex-center">
                        <a class="" 
                        href="/Code"  >
                             
                                
                                    <i class="fa-regular fa-code"></i>
                                
                                CODE
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            

        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="page-main-content-middle">

            <div class="main-content">

                
                    <div class="fade-in-down-animation">
    <div class="post-page-container">
        <div class="article-content-container">

            
            
                <div class="article-title">
                    <h1 class="article-title-regular">TweenManager--cocoscreator</h1>
                </div>
            
                
            

            
                <div class="article-header">
                    <div class="avatar">
                        <img src="/images/redefine-avatar.svg">
                    </div>
                    <div class="info">
                        <div class="author">
                            <span class="name">茶小李</span>
                            
                                <span class="author-label">lol</span>
                            
                        </div>
                        <div class="meta-info">
                            <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="pc">2023-09-15 03:36:47</span>
        <span class="mobile">2023-09-15 03:36</span>
        <span class="hover-info">创建</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="pc">2023-09-15 03:48:35</span>
            <span class="mobile">2023-09-15 03:48</span>
            <span class="hover-info">更新</span>
        </span>
    

    
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fa-regular fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                        </div>
                    </div>
                </div>
            

            <div class="article-content markdown-body">
                <div class="highlight-container" data-rel="Typescript"><figure class="iseeu highlight typescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> &#123; <span class="title class_">UITransform</span>, _decorator, error, game, math &#125; <span class="keyword">from</span> <span class="string">&quot;cc&quot;</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 对象池管理缓动</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> Liz 2019年4月18日21:10:57</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">class</span> <span class="title class_">GTween</span> &#123;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_target</span>:<span class="built_in">any</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetName</span>:<span class="built_in">string</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetTransform</span>:<span class="title class_">UITransform</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetPos</span>:math.<span class="property">Vec3</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetScale</span>:math.<span class="property">Vec3</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetRotation</span>:math.<span class="property">Vec3</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_isTargetSelf</span>:<span class="built_in">boolean</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_targetProps</span>:<span class="built_in">any</span>;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_steps</span>:<span class="built_in">any</span>[];</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_initialProps</span>:<span class="built_in">any</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_stepProps</span>:<span class="built_in">any</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_isStart</span>:<span class="built_in">boolean</span> = <span class="literal">false</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_stepTime</span>:<span class="built_in">number</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_curStep</span>:<span class="built_in">any</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_lastStep</span>:<span class="built_in">any</span>;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_loop</span>:<span class="built_in">boolean</span> = <span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_loopCount</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_loopTotalCount</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_loopComplete</span>:<span class="title class_">Function</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_stepIdx</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_onChange</span>:<span class="title class_">Function</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="attr">_onChangeObj</span>:<span class="built_in">any</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="attr">_tweenId</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">public</span> <span class="attr">resetTime</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">constructor</span>(<span class="params"></span>) &#123;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">setProps</span>(<span class="attr">props</span>:<span class="built_in">any</span>):<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(!props) <span class="keyword">return</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> = props.<span class="property">loopTotalCount</span>;</span><br><span class="line">        <span class="keyword">if</span>(props.<span class="property">loop</span> || (<span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> &gt; <span class="number">0</span>))&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_loop</span> = <span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_onChange</span> = props.<span class="property">onChange</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_onChangeObj</span> = props.<span class="property">onChangeObj</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_loopComplete</span> = props.<span class="property">_loopComplete</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">setTarget</span>(<span class="params">t:<span class="built_in">any</span>,tweenId:<span class="built_in">number</span></span>) &#123;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_target</span> = t;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_tweenId</span> = tweenId;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_initialProps</span> = <span class="literal">null</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">get</span> <span class="title function_">tweenId</span>():<span class="built_in">number</span> &#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_tweenId</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">getTarget</span>():<span class="built_in">any</span> &#123;</span><br><span class="line">		<span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_target</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">to</span>(<span class="attr">props</span>:<span class="built_in">any</span>,duration?:<span class="built_in">number</span>,ease?: <span class="title class_">Function</span>):<span class="title class_">GTween</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_target</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="keyword">if</span>(!props || <span class="title function_">typeof</span>(props) != <span class="string">&quot;object&quot;</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="keyword">if</span>(!duration || duration &lt; <span class="number">0</span>) &#123;</span><br><span class="line">			<span class="keyword">return</span>;</span><br><span class="line">		&#125;</span><br><span class="line">        <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_initialProps</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_initialProps</span> = &#123;&#125;</span><br><span class="line">            <span class="keyword">for</span>(<span class="keyword">let</span> key <span class="keyword">in</span> props) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">_initialProps</span>[key] = <span class="variable language_">this</span>.<span class="title function_">getTargetAttr</span>(key);</span><br><span class="line">                <span class="comment">// this.clearTargetByKey(key);</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">addStep</span>(&#123;</span><br><span class="line">			<span class="attr">type</span>:<span class="string">&quot;to&quot;</span>,</span><br><span class="line">			<span class="attr">props</span>:props,</span><br><span class="line">			<span class="attr">duration</span>:duration,</span><br><span class="line">			<span class="attr">ease</span>:ease&#125;);</span><br><span class="line">		<span class="keyword">return</span> <span class="variable language_">this</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">call</span>(<span class="attr">callback</span>: <span class="title class_">Function</span>, thisObj?: <span class="built_in">any</span>, params?: <span class="built_in">any</span>[]):<span class="title class_">GTween</span> &#123;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">addStep</span>(&#123;</span><br><span class="line">			<span class="keyword">type</span> : <span class="string">&quot;call&quot;</span>,</span><br><span class="line">			callBack : callback,</span><br><span class="line">			thisObj : thisObj,</span><br><span class="line">			params : params&#125;);</span><br><span class="line">		<span class="keyword">return</span> <span class="variable language_">this</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">wait</span>(<span class="attr">time</span>:<span class="built_in">number</span>):<span class="title class_">GTween</span> &#123;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">addStep</span>(&#123;</span><br><span class="line">			<span class="keyword">type</span> : <span class="string">&quot;wait&quot;</span>,</span><br><span class="line">			duration : time&#125;);</span><br><span class="line">		<span class="keyword">return</span> <span class="variable language_">this</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="title function_">addStep</span>(<span class="attr">step</span>:<span class="built_in">any</span>):<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_steps</span>) &#123;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">_steps</span> = [];</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_steps</span>.<span class="title function_">push</span>(step);</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">beginTween</span>();</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	<span class="keyword">private</span> <span class="title function_">beginTween</span>():<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_isStart</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_isStart</span> = <span class="literal">true</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">getStep</span>();</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="title function_">getStep</span>():<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_isStart</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_loop</span>) &#123;</span><br><span class="line">			<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_stepIdx</span> &gt;= <span class="variable language_">this</span>.<span class="property">_steps</span>.<span class="property">length</span>) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">_loopCount</span> ++;</span><br><span class="line">                <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> &gt; <span class="number">0</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">_loopCount</span> &gt;= <span class="variable language_">this</span>.<span class="property">_loopTotalCount</span>)&#123;</span><br><span class="line">                    <span class="comment">//loopComplete</span></span><br><span class="line">                    <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_loopComplete</span>)&#123;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="property">_loopComplete</span>.<span class="title function_">apply</span>(<span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">thisObj</span>);</span><br><span class="line">                        <span class="comment">// this._loopComplete.call();</span></span><br><span class="line">                    &#125;</span><br><span class="line">                    <span class="variable language_">this</span>.<span class="title function_">stopAction</span>();</span><br><span class="line">                    <span class="keyword">return</span></span><br><span class="line">                &#125;</span><br><span class="line">				<span class="variable language_">this</span>.<span class="property">_stepIdx</span> = <span class="number">0</span>;</span><br><span class="line">                <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_initialProps</span>)&#123;</span><br><span class="line">                    <span class="keyword">for</span>(<span class="keyword">let</span> key <span class="keyword">in</span> <span class="variable language_">this</span>.<span class="property">_initialProps</span>) &#123;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="title function_">setTargetAttr</span>(key,<span class="variable language_">this</span>.<span class="property">_initialProps</span>[key]);</span><br><span class="line">                        <span class="comment">// this._target[key] = this._initialProps[key];</span></span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="comment">//一轮循环结束，属性已经重设到初始值，不用校正</span></span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">_lastStep</span> = <span class="literal">null</span>;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">_curStep</span> = <span class="variable language_">this</span>.<span class="property">_steps</span>[<span class="variable language_">this</span>.<span class="property">_stepIdx</span>];</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">_stepIdx</span> ++;</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="keyword">else</span> &#123;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">_curStep</span> = <span class="variable language_">this</span>.<span class="property">_steps</span>.<span class="title function_">shift</span>();</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="comment">//属性校正</span></span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_lastStep</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">_lastStep</span>.<span class="property">props</span>) &#123;</span><br><span class="line">			<span class="keyword">for</span>(<span class="keyword">let</span> key <span class="keyword">in</span> <span class="variable language_">this</span>.<span class="property">_lastStep</span>.<span class="property">props</span>) &#123;</span><br><span class="line">				<span class="comment">// this._target[key] = this._lastStep.props[key];</span></span><br><span class="line">                <span class="variable language_">this</span>.<span class="title function_">setTargetAttr</span>(key,<span class="variable language_">this</span>.<span class="property">_lastStep</span>.<span class="property">props</span>[key]);</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_lastStep</span> = <span class="variable language_">this</span>.<span class="property">_curStep</span>;</span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_curStep</span>) &#123;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="title function_">stopAction</span>();</span><br><span class="line">			<span class="keyword">return</span>;</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">type</span> == <span class="string">&quot;call&quot;</span>) &#123;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">callBack</span>.<span class="title function_">apply</span>(<span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">thisObj</span>,<span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">params</span>);</span><br><span class="line">			<span class="variable language_">this</span>.<span class="title function_">getStep</span>();</span><br><span class="line">			<span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_stepTime</span> = game.<span class="property">totalTime</span> + <span class="variable language_">this</span>.<span class="property">_curStep</span>.<span class="property">duration</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_stepProps</span> = &#123;&#125;;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_targetProps</span> = &#123;&#125;;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="title function_">runAction</span>();</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="attr">timeIndex</span>:<span class="built_in">number</span> = -<span class="number">1</span>;</span><br><span class="line">	<span class="keyword">private</span> <span class="title function_">runAction</span>():<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">timeIndex</span> == -<span class="number">1</span>) &#123;</span><br><span class="line">            <span class="keyword">let</span> self = <span class="variable language_">this</span>;</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">timeIndex</span> = <span class="built_in">setInterval</span>(<span class="keyword">function</span>(<span class="params"></span>)&#123;</span><br><span class="line">				<span class="keyword">let</span> <span class="attr">curTime</span>:<span class="built_in">number</span> = game.<span class="property">totalTime</span>;</span><br><span class="line">				<span class="keyword">if</span>(curTime &gt;= self.<span class="property">_stepTime</span>)&#123;</span><br><span class="line">					self.<span class="title function_">getStep</span>();</span><br><span class="line">					<span class="keyword">return</span>;</span><br><span class="line">				&#125;</span><br><span class="line">				<span class="keyword">if</span>(self.<span class="property">_curStep</span>.<span class="property">type</span> == <span class="string">&quot;to&quot;</span>) &#123;</span><br><span class="line">					<span class="keyword">let</span> <span class="attr">props</span>:<span class="built_in">any</span> = self.<span class="property">_curStep</span>.<span class="property">props</span>;</span><br><span class="line">					<span class="keyword">let</span> <span class="attr">ratio</span>:<span class="built_in">number</span> = (self.<span class="property">_curStep</span>.<span class="property">duration</span> - (self.<span class="property">_stepTime</span> - curTime)) / self.<span class="property">_curStep</span>.<span class="property">duration</span>;</span><br><span class="line">					ratio = <span class="title class_">Math</span>.<span class="title function_">min</span>(ratio,<span class="number">1</span>);</span><br><span class="line">					<span class="keyword">if</span>(self.<span class="property">_curStep</span>.<span class="property">ease</span>) &#123;</span><br><span class="line">						ratio = self.<span class="property">_curStep</span>.<span class="title function_">ease</span>(ratio,<span class="number">0</span>,<span class="number">1</span>,<span class="number">1</span>);</span><br><span class="line">					&#125;</span><br><span class="line">					<span class="keyword">for</span>(<span class="keyword">let</span> keyName <span class="keyword">in</span> props) &#123;</span><br><span class="line">						<span class="keyword">if</span>(self.<span class="property">_stepProps</span>[keyName] == <span class="literal">undefined</span>) &#123;</span><br><span class="line">							self.<span class="property">_stepProps</span>[keyName] = self.<span class="title function_">getTargetAttr</span>(keyName);</span><br><span class="line">						&#125;</span><br><span class="line">						<span class="keyword">let</span> <span class="attr">diff</span>:<span class="built_in">number</span> = props[keyName] - self.<span class="property">_stepProps</span>[keyName];</span><br><span class="line">                        <span class="keyword">let</span> value = self.<span class="property">_stepProps</span>[keyName] + (diff * ratio);</span><br><span class="line">                        self.<span class="property">_targetProps</span>[keyName] = value;</span><br><span class="line">                        self.<span class="title function_">setTargetAttr</span>(keyName,value);</span><br><span class="line">					&#125;</span><br><span class="line">				&#125;</span><br><span class="line">				<span class="keyword">if</span>(self.<span class="property">_onChange</span> &amp;&amp; self.<span class="property">_onChangeObj</span>) &#123;</span><br><span class="line">					self.<span class="property">_onChange</span>.<span class="title function_">apply</span>(self.<span class="property">_onChangeObj</span>,self.<span class="property">_targetProps</span>);</span><br><span class="line">				&#125;</span><br><span class="line">			&#125;,<span class="number">1</span>);</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">checkTargetAttr</span>(<span class="params">k:<span class="built_in">string</span></span>)&#123;</span><br><span class="line">        <span class="keyword">let</span> errorTips = <span class="string">&quot;&quot;</span>;</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">ccIdx</span>:<span class="built_in">number</span> = <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="property">__classname__</span>.<span class="title function_">indexOf</span>(<span class="string">&quot;cc.&quot;</span>);</span><br><span class="line">        <span class="keyword">if</span> (<span class="title function_">typeof</span>(<span class="variable language_">this</span>.<span class="property">_target</span>) == <span class="string">&quot;object&quot;</span> &amp;&amp; ccIdx == -<span class="number">1</span>)&#123;</span><br><span class="line">            <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_target</span>[k])&#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">_isTargetSelf</span> = <span class="literal">true</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span>&#123;</span><br><span class="line">                errorTips = <span class="string">&quot;not found &quot;</span> + k + <span class="string">&quot; in tween target.&quot;</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_target</span> == <span class="literal">null</span>)&#123;</span><br><span class="line">                errorTips = <span class="string">&quot;tween target is null&quot;</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span>&#123;</span><br><span class="line">                <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_targetTransform</span>)&#123;</span><br><span class="line">                    <span class="variable language_">this</span>.<span class="property">_targetTransform</span> = <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">getComponent</span>(<span class="title class_">UITransform</span>);</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_targetTransform</span>)&#123;</span><br><span class="line">                    errorTips = <span class="string">&quot;not found transform in tween target. ----key：&quot;</span> + k;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span>(errorTips == <span class="string">&quot;&quot;</span>)&#123;</span><br><span class="line">            <span class="keyword">if</span>(k == <span class="string">&quot;x&quot;</span> || k == <span class="string">&quot;y&quot;</span> || k == <span class="string">&quot;z&quot;</span>)&#123;</span><br><span class="line">                <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_targetPos</span>)&#123;</span><br><span class="line">                    <span class="variable language_">this</span>.<span class="property">_targetPos</span> = <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">getPosition</span>();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;scaleX&quot;</span> || k == <span class="string">&quot;scaleY&quot;</span> || k == <span class="string">&quot;scaleZ&quot;</span>)&#123;</span><br><span class="line">                <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_targetScale</span>)&#123;</span><br><span class="line">                    <span class="variable language_">this</span>.<span class="property">_targetScale</span> = <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">getScale</span>();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;rotationX&quot;</span> || k == <span class="string">&quot;rotationY&quot;</span> || k == <span class="string">&quot;rotationZ&quot;</span>)&#123;</span><br><span class="line">                <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_targetRotation</span>)&#123;</span><br><span class="line">                    <span class="variable language_">this</span>.<span class="property">_targetRotation</span> = <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">getRotation</span>();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;width&quot;</span> || k == <span class="string">&quot;height&quot;</span>)&#123;</span><br><span class="line">               </span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">else</span> <span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_target</span>[k])&#123;</span><br><span class="line">                errorTips = <span class="string">&quot;not found &quot;</span> + k + <span class="string">&quot; in tween target.&quot;</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(errorTips != <span class="string">&quot;&quot;</span>)&#123;</span><br><span class="line">            <span class="keyword">let</span> <span class="attr">curStepStr</span>:<span class="built_in">string</span> = <span class="variable language_">this</span>.<span class="title function_">getStepTestStr</span>(<span class="variable language_">this</span>.<span class="property">_curStep</span>);</span><br><span class="line">            <span class="keyword">let</span> <span class="attr">stepStr</span>:<span class="built_in">string</span> = <span class="string">&quot;&quot;</span>;</span><br><span class="line">            <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_steps</span>)&#123;</span><br><span class="line">                <span class="keyword">for</span>(<span class="keyword">let</span> <span class="attr">i</span>:<span class="built_in">number</span> = <span class="number">0</span>; i &lt; <span class="variable language_">this</span>.<span class="property">_steps</span>.<span class="property">length</span>; i ++)&#123;</span><br><span class="line">                    stepStr = stepStr + <span class="string">&quot;(step&quot;</span> + i + <span class="string">&quot;)&quot;</span> + <span class="variable language_">this</span>.<span class="title function_">getStepTestStr</span>(<span class="variable language_">this</span>.<span class="property">_steps</span>[i]);</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">let</span> targetName = <span class="variable language_">this</span>.<span class="property">_targetName</span>;</span><br><span class="line">            <span class="title class_">TweenManager</span>.<span class="title class_">RemoveTweenById</span>(<span class="variable language_">this</span>.<span class="property">_tweenId</span>);</span><br><span class="line">            <span class="title function_">error</span>(errorTips + <span class="string">&quot;---&gt;&gt;&gt;targetName：&quot;</span> + targetName + <span class="string">&quot;，curStep：&quot;</span> + curStepStr + <span class="string">&quot;，stepList：&quot;</span> + stepStr);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">getStepTestStr</span>(<span class="attr">step</span>:<span class="built_in">any</span>):<span class="built_in">string</span>&#123;</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">stepStr</span>:<span class="built_in">string</span> = <span class="string">&quot;&quot;</span>;</span><br><span class="line">        <span class="keyword">if</span>(step)&#123;</span><br><span class="line">            stepStr = step.<span class="property">type</span></span><br><span class="line">            <span class="keyword">if</span>(step.<span class="property">props</span>)&#123;</span><br><span class="line">                <span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">in</span> step.<span class="property">props</span>) &#123;</span><br><span class="line">                    <span class="keyword">let</span> v = step.<span class="property">props</span>[key];</span><br><span class="line">                    stepStr = stepStr + <span class="string">&quot;--&gt;&quot;</span> + key + <span class="string">&quot;=&quot;</span> + v + <span class="string">&quot;,&quot;</span>;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span>(step.<span class="property">duration</span>)&#123;</span><br><span class="line">                stepStr = stepStr + <span class="string">&quot;time：&quot;</span> + step.<span class="property">duration</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> stepStr;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">setTargetAttr</span>(<span class="params">k: <span class="built_in">string</span>,v: <span class="built_in">any</span></span>)&#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">checkTargetAttr</span>(k);</span><br><span class="line">        <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_isTargetSelf</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_target</span>[k] = v;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(k == <span class="string">&quot;x&quot;</span> || k == <span class="string">&quot;y&quot;</span> || k == <span class="string">&quot;z&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetPos</span>[k] = v;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">setPosition</span>(<span class="variable language_">this</span>.<span class="property">_targetPos</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;scaleX&quot;</span> || k == <span class="string">&quot;scaleY&quot;</span> || k == <span class="string">&quot;scaleZ&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetScale</span>[<span class="title class_">TweenManager</span>.<span class="title class_">GetTweenAttrName</span>(k)] = v;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">setScale</span>(<span class="variable language_">this</span>.<span class="property">_targetScale</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;rotationX&quot;</span> || k == <span class="string">&quot;rotationY&quot;</span> || k == <span class="string">&quot;rotationZ&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetRotation</span>[<span class="title class_">TweenManager</span>.<span class="title class_">GetTweenAttrName</span>(k)] = v;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_target</span>.<span class="title function_">setRotation</span>(<span class="variable language_">this</span>.<span class="property">_targetRotation</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;width&quot;</span> || k == <span class="string">&quot;height&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetTransform</span>[k] = v;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_target</span>[k])&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_target</span>[k] = v;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">getTargetAttr</span>(<span class="params">k</span>)&#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">checkTargetAttr</span>(k);</span><br><span class="line">        <span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">_isTargetSelf</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_target</span>[k];</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(k == <span class="string">&quot;x&quot;</span> || k == <span class="string">&quot;y&quot;</span> || k == <span class="string">&quot;z&quot;</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_targetPos</span>[k];</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;scaleX&quot;</span> || k == <span class="string">&quot;scaleY&quot;</span> || k == <span class="string">&quot;scaleZ&quot;</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_targetScale</span>[<span class="title class_">TweenManager</span>.<span class="title class_">GetTweenAttrName</span>(k)];</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;rotationX&quot;</span> || k == <span class="string">&quot;rotationY&quot;</span> || k == <span class="string">&quot;rotationZ&quot;</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_targetRotation</span>[<span class="title class_">TweenManager</span>.<span class="title class_">GetTweenAttrName</span>(k)];</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">_target</span>[k];</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="title function_">stopAction</span>():<span class="built_in">void</span> &#123;</span><br><span class="line">        <span class="comment">// if not self.isStart or self.tweenId == 0 then return end</span></span><br><span class="line">		<span class="comment">//     TweenUtil.RemoveTween(self.tweenId)</span></span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_isStart</span> || <span class="variable language_">this</span>.<span class="property">_tweenId</span> == <span class="number">0</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="title class_">TweenManager</span>.<span class="title class_">RemoveTweenById</span>(<span class="variable language_">this</span>.<span class="property">_tweenId</span>);</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">public</span> <span class="title function_">reset</span>():<span class="built_in">void</span> &#123;</span><br><span class="line">		<span class="keyword">if</span>(!<span class="variable language_">this</span>.<span class="property">_isStart</span>) <span class="keyword">return</span>;</span><br><span class="line">		<span class="keyword">if</span>(<span class="variable language_">this</span>.<span class="property">timeIndex</span> != -<span class="number">1</span>) &#123;</span><br><span class="line">            <span class="built_in">clearInterval</span>(<span class="variable language_">this</span>.<span class="property">timeIndex</span>);</span><br><span class="line">			<span class="variable language_">this</span>.<span class="property">timeIndex</span> = -<span class="number">1</span>;</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_stepIdx</span> = <span class="number">0</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_loop</span> = <span class="literal">false</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_loopTotalCount</span> = -<span class="number">1</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_loopCount</span> = <span class="number">0</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_loopComplete</span> = <span class="literal">null</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_onChangeObj</span> = <span class="literal">null</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_onChange</span> = <span class="literal">null</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">clearTarget</span>();</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_initialProps</span> = &#123;&#125;;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_steps</span> = <span class="literal">null</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_curStep</span> = <span class="literal">null</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_lastStep</span> = <span class="literal">null</span>;</span><br><span class="line">		<span class="variable language_">this</span>.<span class="property">_isStart</span> = <span class="literal">false</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_tweenId</span> = <span class="number">0</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">clearTarget</span>(<span class="params"></span>)&#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">_target</span> = <span class="literal">null</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_targetPos</span> = <span class="literal">null</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_targetTransform</span> = <span class="literal">null</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_targetScale</span> = <span class="literal">null</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_targetRotation</span> = <span class="literal">null</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_isTargetSelf</span> = <span class="literal">false</span></span><br><span class="line">	    <span class="variable language_">this</span>.<span class="property">_targetName</span> = <span class="string">&quot;&quot;</span></span><br><span class="line">    &#125;</span><br><span class="line">		</span><br><span class="line">    <span class="keyword">private</span> <span class="title function_">clearTargetByKey</span>(<span class="params">k:<span class="built_in">string</span></span>)&#123;</span><br><span class="line">        <span class="keyword">if</span>(k == <span class="string">&quot;x&quot;</span> || k == <span class="string">&quot;y&quot;</span> || k == <span class="string">&quot;z&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetPos</span> = <span class="literal">null</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;scaleX&quot;</span> || k == <span class="string">&quot;scaleY&quot;</span> || k == <span class="string">&quot;scaleZ&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetScale</span> = <span class="literal">null</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;rotationX&quot;</span> || k == <span class="string">&quot;rotationY&quot;</span> || k == <span class="string">&quot;rotationZ&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetRotation</span> = <span class="literal">null</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(k == <span class="string">&quot;width&quot;</span> || k == <span class="string">&quot;height&quot;</span>)&#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">_targetTransform</span> = <span class="literal">null</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> <span class="keyword">class</span> <span class="title class_">TweenManager</span> &#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="title class_">TweenPool</span>:<span class="title class_">GTween</span>[] = [];</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title function_">getTween</span>():<span class="title class_">GTween</span> &#123;</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">tw</span>:<span class="title class_">GTween</span>;</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">time</span>:<span class="built_in">number</span> = game.<span class="property">totalTime</span>;</span><br><span class="line">        <span class="keyword">for</span>(<span class="keyword">let</span> i = <span class="number">0</span>; i &lt; <span class="title class_">TweenManager</span>.<span class="property">TweenPool</span>.<span class="property">length</span>; i ++)&#123;</span><br><span class="line">            <span class="keyword">let</span> <span class="attr">pool</span>:<span class="title class_">GTween</span> = <span class="title class_">TweenManager</span>.<span class="property">TweenPool</span>[i];</span><br><span class="line">            <span class="keyword">if</span>(time - pool.<span class="property">resetTime</span> &gt; <span class="number">0.034</span>)&#123;</span><br><span class="line">                tw = <span class="title class_">TweenManager</span>.<span class="property">TweenPool</span>.<span class="title function_">shift</span>();</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!tw)&#123;</span><br><span class="line">            tw = <span class="keyword">new</span> <span class="title class_">GTween</span>();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> tw;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// public static TweenList:GTween[] = [];</span></span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title class_">TweenAttrMap</span>:<span class="built_in">any</span> = &#123;</span><br><span class="line">        scaleX : <span class="string">&quot;x&quot;</span>,</span><br><span class="line">        scaleY : <span class="string">&quot;y&quot;</span>,</span><br><span class="line">        scaleZ : <span class="string">&quot;z&quot;</span>,</span><br><span class="line">        rotationX : <span class="string">&quot;x&quot;</span>,</span><br><span class="line">        rotationY : <span class="string">&quot;y&quot;</span>,</span><br><span class="line">        rotationZ : <span class="string">&quot;z&quot;</span>,</span><br><span class="line">        width : <span class="string">&quot;width&quot;</span>,</span><br><span class="line">        height : <span class="string">&quot;height&quot;</span>,</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title class_">TweenId</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title class_">TweenCount</span>:<span class="built_in">number</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title class_">TweenList</span> = &#123;&#125;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="title class_">TweenTargets</span> = &#123;&#125;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="title function_">addTween</span>(<span class="attr">target</span>:<span class="built_in">any</span>,props?:<span class="built_in">any</span>):<span class="title class_">GTween</span> &#123;</span><br><span class="line">        <span class="keyword">if</span>(!target) <span class="keyword">return</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">let</span> <span class="attr">tw</span>:<span class="title class_">GTween</span> = <span class="title class_">TweenManager</span>.<span class="title function_">getTween</span>();</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">tweenId</span>:<span class="built_in">number</span> = <span class="title class_">TweenManager</span>.<span class="property">TweenId</span> + <span class="number">1</span>;</span><br><span class="line">        tw.<span class="title function_">setTarget</span>(target,tweenId);</span><br><span class="line">        tw.<span class="title function_">setProps</span>(props);</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenId</span> = tweenId;</span><br><span class="line">        <span class="comment">// if(!target.gtween_count) &#123;</span></span><br><span class="line">        <span class="comment">//     target.gtween_count = 0;</span></span><br><span class="line">        <span class="comment">// &#125;</span></span><br><span class="line">        <span class="comment">// target.gtween_count++;</span></span><br><span class="line">        <span class="comment">// TweenManager.TweenList.push(tw);</span></span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenList</span>[tweenId] = tw;</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenTargets</span>[tweenId] = target;</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenCount</span> ++;</span><br><span class="line">        <span class="comment">// console.log(&quot;当前缓动数量：&quot;,TweenManager.TweenList.length,&quot;缓动池数量：&quot;,TweenManager.TweenPool.length);</span></span><br><span class="line">        <span class="keyword">return</span> tw;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="title function_">removeTweens</span>(<span class="attr">target</span>:<span class="built_in">any</span>):<span class="built_in">void</span> &#123;</span><br><span class="line">        <span class="keyword">if</span>(!target)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">// if(!target.gtween_count || target.gtween_count == 0) return;</span></span><br><span class="line">        <span class="keyword">for</span>(<span class="keyword">let</span> tweenId <span class="keyword">in</span> <span class="title class_">TweenManager</span>.<span class="property">TweenTargets</span>)&#123;</span><br><span class="line">            <span class="keyword">let</span> <span class="attr">id</span>:<span class="built_in">number</span> = <span class="title class_">Number</span>(tweenId);</span><br><span class="line">            <span class="keyword">let</span> t = <span class="title class_">TweenManager</span>.<span class="property">TweenTargets</span>[id];</span><br><span class="line">            <span class="keyword">if</span>(t == target)&#123;</span><br><span class="line">                <span class="title class_">TweenManager</span>.<span class="title class_">RemoveTweenById</span>(id);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">// let tws:GTween[] = TweenManager.TweenList;</span></span><br><span class="line">        <span class="comment">// for(let i:number = tws.length - 1; i &gt;= 0; i--) &#123;</span></span><br><span class="line">        <span class="comment">//     if(tws[i].getTarget() == target) &#123;</span></span><br><span class="line">        <span class="comment">//         tws[i].reset();</span></span><br><span class="line">        <span class="comment">//         tws.splice(i,1);</span></span><br><span class="line">        <span class="comment">//     &#125;</span></span><br><span class="line">        <span class="comment">// &#125;</span></span><br><span class="line">        <span class="comment">// target.gtween_count = 0;</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="title class_">RemoveTweenById</span>(<span class="attr">tweenId</span>:<span class="built_in">number</span>)&#123;</span><br><span class="line">        <span class="keyword">if</span>(!tweenId || tweenId == <span class="number">0</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">let</span> <span class="attr">tw</span>:<span class="title class_">GTween</span> = <span class="title class_">TweenManager</span>.<span class="property">TweenList</span>[tweenId];</span><br><span class="line">        <span class="keyword">if</span>(!tw)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        tw.<span class="title function_">reset</span>();</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenList</span>[tweenId] = <span class="literal">null</span>;</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenTargets</span>[tweenId] = <span class="literal">null</span>;</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenCount</span> --;</span><br><span class="line">        tw.<span class="property">resetTime</span> = game.<span class="property">totalTime</span>;</span><br><span class="line">        <span class="title class_">TweenManager</span>.<span class="property">TweenPool</span>.<span class="title function_">push</span>(tw);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">	<span class="comment">// 	public.RemoveTween = function(tweenId)</span></span><br><span class="line">    <span class="comment">//     if not tweenId or tweenId == 0 then</span></span><br><span class="line">    <span class="comment">//         return </span></span><br><span class="line">    <span class="comment">//     end</span></span><br><span class="line">    <span class="comment">//     local tw = private.TweenList[tweenId]</span></span><br><span class="line">    <span class="comment">//     if not tw then</span></span><br><span class="line">    <span class="comment">//         return</span></span><br><span class="line">    <span class="comment">//     end</span></span><br><span class="line">    <span class="comment">//     tw:Reset()</span></span><br><span class="line">    <span class="comment">//     private.TweenList[tweenId] = nil</span></span><br><span class="line">    <span class="comment">//     private.TweenTargets[tweenId] = nil</span></span><br><span class="line">    <span class="comment">//     private.tweenCount = private.tweenCount - 1</span></span><br><span class="line">    <span class="comment">//     tw.resetTime = Time.time</span></span><br><span class="line">    <span class="comment">//     table.insert(private.TweenPool,tw)</span></span><br><span class="line">    <span class="comment">// end</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="title class_">GetTweenAttrName</span>(<span class="attr">attrName</span>:<span class="built_in">string</span>)&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="title class_">TweenManager</span>.<span class="property">TweenAttrMap</span>[attrName];</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>
            </div>

            
                <div class="post-copyright-info">
                    <div class="article-copyright-info-container">
    <ul>
        <li>本文标题：TweenManager--cocoscreator</li>
        <li>本文作者：茶小李</li>
        <li>创建时间：2023-09-15 03:36:47</li>
        <li>
            本文链接：https://redefine.ohevan.com/2023/09/15/TweenManager/
        </li>
        <li>
            版权声明：本博客所有文章除特别声明外，均采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">BY-NC-SA</a> 许可协议。转载请注明出处！
        </li>
    </ul>
</div>

                </div>
            

            

            

            
                <div class="article-nav">
                    
                    
                        <div class="article-next">
                            <a class="next"
                            rel="next"
                            href="/2023/04/19/%E5%BA%97%E9%93%BA%E8%A3%85%E4%BF%AE/"
                            >
                                <span class="title flex-center">
                                    <span class="post-nav-title-item">店铺装修</span>
                                    <span class="post-nav-item">下一篇</span>
                                </span>
                                <span class="right arrow-icon flex-center">
                                    <i class="fa-solid fa-chevron-right"></i>
                                </span>
                            </a>
                        </div>
                    
                </div>
            


            
        </div>

        
            <div class="toc-content-container">
                <div class="post-toc-wrap">
    <div class="post-toc">
        <div class="toc-title">此页目录</div>
        <div class="page-title">TweenManager--cocoscreator</div>
        

    </div>
</div>
            </div>
        
    </div>
</div>


                

            </div>



        </div>

        <div class="page-main-content-bottom">
            <footer class="footer">
    <div class="info-container">
        <div class="copyright-info">
            &copy;
            
              <span>2023</span>
              -
            
            2023&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">茶小李</a>
        </div>
        
            <script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="website-count info-item">
                
                    <span id="busuanzi_container_site_uv" class="busuanzi_container_site_uv">
                        访问人数&nbsp;<span id="busuanzi_value_site_uv" class="busuanzi_value_site_uv"></span>
                    </span>
                
                
                    <span id="busuanzi_container_site_pv" class="busuanzi_container_site_pv">
                        总访问量&nbsp;<span id="busuanzi_value_site_pv" class="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        <div class="theme-info info-item">
            <span class="powered-by-container">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" href="https://hexo.io">Hexo</a> 驱动</span>
                <br> 
            <span class="theme-version-container">主题&nbsp;<a class="theme-version" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v1.2.1</a>
        </div>
        
        
        
            <div id="start_time_div" style="display:none">
                2023/3/16 23:00:00
            </div>
            <div>
                博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
            </div>
        
        
        
            <script async data-pjax>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="tools-list">
        <!-- TOC aside toggle -->
        
            <li class="right-bottom-tools page-aside-toggle">
                <i class="fa-regular fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
    </ul>
</div>

        </div>
    

    <div class="right-bottom-side-tools">
        <div class="side-tools-container">
    <ul class="unfolded-tools-list">
        <li class="right-bottom-tools tool-font-adjust-plus flex-center">
            <i class="fa-regular fa-magnifying-glass-plus"></i>
        </li>

        <li class="right-bottom-tools tool-font-adjust-minus flex-center">
            <i class="fa-regular fa-magnifying-glass-minus"></i>
        </li>

        <li class="right-bottom-tools tool-expand-width flex-center">
            <i class="fa-regular fa-expand"></i>
        </li>

        <li class="right-bottom-tools tool-dark-light-toggle flex-center">
            <i class="fa-regular fa-moon"></i>
        </li>

        <!-- rss -->
        

        
            <li class="right-bottom-tools tool-scroll-to-top flex-center">
                <i class="fa-regular fa-arrow-up"></i>
            </li>
        

        <li class="right-bottom-tools tool-scroll-to-bottom flex-center">
            <i class="fa-regular fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="folded-tools-list">
        <li class="right-bottom-tools tool-toggle-show flex-center">
            <i class="fa-regular fa-cog fa-spin"></i>
        </li>
        
    </ul>
</div>

    </div>

    <div class="image-viewer-container">
    <img src="">
</div>


    


</main>




<script src="/js/utils.js"></script>

<script src="/js/main.js"></script>

<script src="/js/layouts/menu-shrink.js"></script>

<script src="/js/tools/go-top-bottom.js"></script>

<script src="/js/tools/dark-light-toggle.js"></script>





    
<script src="/js/tools/code-block.js"></script>




    
<script src="/js/layouts/lazyload.js"></script>




    
<script src="/js/tools/runtime.js"></script>

    
<script src="/js/layouts/odometer.min.js"></script>

    
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">









<div class="post-scripts pjax">
    
        
<script src="/js/tools/toc-toggle.js"></script>

<script src="/js/libs/anime.min.js"></script>

<script src="/js/layouts/toc.js"></script>

<script src="/js/plugins/tabs.js"></script>

    
</div>


    
<script src="/js/libs/pjax.min.js"></script>

<script>
    window.addEventListener('DOMContentLoaded', () => {
        window.pjax = new Pjax({
            selectors: [
                'head title',
                '.page-container',
                '.pjax'
            ],
            history: true,
            debug: false,
            cacheBust: false,
            timeout: 0,
            analytics: false,
            currentUrlFullReload: false,
            scrollRestoration: false,
            // scrollTo: true,
        });

        document.addEventListener('pjax:send', () => {
            REDEFINE.utils.pjaxProgressBarStart();
        });

        document.addEventListener('pjax:complete', () => {
            REDEFINE.utils.pjaxProgressBarEnd();
            window.pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
            REDEFINE.refresh();
        });
    });
</script>




    <div id="aplayer"></div>

<script src="/js/libs/APlayer.min.js"></script>


<script src="/js/plugins/aplayer.js"></script>


</body>
</html>
